package com.middlegroup.payadmin.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.middlegroup.payadmin.mapper.InBillsMapper;
import com.middlegroup.payadmin.pojo.dto.BillsDto;
import com.middlegroup.payadmin.pojo.dto.DataGrid;
import com.middlegroup.payadmin.pojo.po.InBills;
import com.middlegroup.payadmin.service.InBillsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author pc123
 * @since 2019-01-04
 */
@Service
public class InBillsServiceImpl extends ServiceImpl<InBillsMapper, InBills> implements InBillsService {

    @Resource
    private InBillsMapper inBillsMapper;

    @Override
    public PageInfo<BillsDto> listBills(DataGrid grid, BillsDto billsDto) {
        grid.getOrderBy();
        return PageHelper.startPage(grid.getPageNum(), grid.getPageSize())
                .doSelectPageInfo(() -> this.inBillsMapper.listBills(billsDto));
    }
}
